﻿using ComicQ.Domain.Table;
using FluentNHibernate.Mapping;

namespace ComicQ.Domain.Mapping
{
    sealed class ComicMap : ClassMap<Comic>
    {
        public ComicMap()
        {
            Id(x => x.Id);
            Map(x => x.Title);
            References(x => x.Author).Cascade.None();
            References(x => x.Publisher).Cascade.None();
            References(x => x.Year).Cascade.None();
            References(x => x.Rent).Cascade.None();
            References(x => x.ComicStatus).Cascade.None();
            Map(x => x.Image);
            HasMany(x => x.OrderDetails).Cascade.All().Inverse();
            HasMany(x => x.Comments).Cascade.All().Inverse();
        }
    }
}
